using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using MULENetworking;

namespace MULEServer
{
    /// <summary>
    /// Implementation of our remote object interfaces for access through the network.
    /// </summary>
    [Serializable]
    public class RemotePlayer : MarshalByRefObject, IPlayer
    {
        #region IPlayer Variables

        private string playerName, playerMuleType;
        private int playerNumber, playerEnergy, playerFood, playerCrystite, playerSmithore, playerNetworth, playerAvatar, playerMoney;
        private System.Drawing.Color playerColor;
        private bool playerHasMule, playerIsActive;

        #endregion

        public RemotePlayer(string myName)
        {
            playerName = name;
            playerNumber = -1;
            playerEnergy = -1;
            playerFood = -1;
            playerCrystite = -1;
            playerSmithore = -1;
            playerNetworth = -1;
            playerAvatar = -1;
            playerHasMule = false;
            playerIsActive = false;
            playerColor = System.Drawing.Color.Empty;
        }

        #region IPlayer Members

        public string name
        {
            get
            {
                return playerName;
            }
            set
            {
                playerName = value;
            }
        }

        public int number
        {
            get
            {
                return playerNumber;
            }
            set
            {
                playerNumber = value;
            }
        }

        public System.Drawing.Color color
        {
            get
            {
                return playerColor;
            }
            set
            {
                playerColor = value;
            }
        }

        public int energy
        {
            get
            {
                return playerEnergy;
            }
            set
            {
                playerEnergy = value;
            }
        }

        public int food
        {
            get
            {
                return playerFood;
            }
            set
            {
                playerFood = value;
            }
        }

        public int smithore
        {
            get
            {
                return playerSmithore;
            }
            set
            {
                playerSmithore = value;
            }
        }

        public int crystite
        {
            get
            {
                return playerCrystite;
            }
            set
            {
                playerCrystite = value;
            }
        }

        public bool hasMule
        {
            get
            {
                return playerHasMule;
            }
            set
            {
                playerHasMule = value;
            }
        }

        public bool myTurn
        {
            get
            {
                return playerIsActive;
            }
            set
            {
                playerIsActive = value;
            }
        }

        public int networth
        {
            get
            {
                return playerNetworth;
            }
            set
            {
                playerNetworth = value;
            }
        }

        public int avatar
        {
            get
            {
                return playerAvatar;
            }
            set
            {
                playerAvatar = value;
            }
        }
        public int money
        {
            get
            {
                return playerMoney;
            }
            set
            {
                playerMoney = value;
            }
        }

        public string muleType
        {
            get
            {
                return playerMuleType;
            }
            set
            {
                playerMuleType = value;
            }
        }

        #endregion
    }
}
